<template>
	<view>
		<uni-nav-bar dark title="机构管理" fixed :statusBar="true" left-icon="left" @clickLeft="onLeft">
			<block slot="right">
				<view class="city">
					<view @click="onSwitch">
						切换机构
					</view>
				</view>
			</block>
		</uni-nav-bar>
		<view class="header">
			<view class="info">
				<text>{{infoData.name}}</text>
				<view>其他</view>
			</view>
			<view class="img">
				<image src="../../static/logo.png" mode="aspectFit"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {getdynamic} from '@/api/mechanism/index.js'
	export default {
		data() {
			return {
				infoData: {}
			}
		},
		methods: {
			onLeft() {
				uni.navigateBack()
			},
			onSwitch() {
				 uni.navigateTo({
				 	url: '/pages/mechanism/list'
				 })
			}
		},
		onLoad() {
			let {organizationId} = uni.getStorageSync('userInfo')
			console.log(organizationId)
			getdynamic(organizationId).then(res => {
				this.infoData = res.data
			})
		}
	}
</script>

<style scoped lang="scss">
.header {
 display: flex;
 padding: 30rpx 20rpx;
 .info {
	 width: calc(100% - 200rpx);
	 display: flex;
	 flex-direction: column;
	 text {
		 font-size: 40rpx;
		 margin-bottom: 20rpx;
	 }
	 view {
		 border: 1px solid #ddd;
		 width: 100rpx;
		 text-align: center;
		 padding: 10rpx 0;
		 font-size: 24rpx;
	 }
 }
 .img {
	 width: 200rpx;
	 height: 200rpx;
	  border-radius: 100rpx;
	 image {
		 width: 100%;
		 height: 100%;
		 border-radius: 100rpx;
	 }
 }
}
</style>
